package com.es.main;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

@SuppressWarnings("serial")
public class LoginOffAction extends ActionSupport implements ServletRequestAware{
	
  HttpServletRequest request;

  public String execute() throws Exception{
    request.setCharacterEncoding("utf-8");
    HttpSession session = request.getSession(false);
    LoginUserBeen loginuser = new LoginUserBeen();
    if(session!=null)
    	loginuser = (LoginUserBeen)session.getAttribute("loginuser");
    
    loginuser = null;
    session.invalidate();    
    return "success";
  }

  public void setServletRequest(HttpServletRequest request) {
    this.request = request;
  }
}
